package org.spamforces.dao.impl;

import org.spamforces.dao.UserDao;
import org.spamforces.model.User;

/**
 * @author MikeMirzayanov (mirzayanovmr@gmail.com)
 */
public class UserDaoImpl extends ApplicationDaoImpl<User> implements UserDao {
    @Override
    public User find(String email) {
        return findOnlyBy(true, "email=?", email);
    }

    @Override
    public User authenticate(String email, String password) {
        return findOnlyBy(true, "email=? AND passwordSha1=SHA1(?)", email, password);
    }
}
